package com.ysd.lis.entity.eq;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ysd.lis.entity.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.sql.Timestamp;
import java.util.List;

/**
 * <p>
 * 设备管理-设备类型
 * </p>
 *
 * @author prs
 * @since 2024-08-16
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("EQ_MAINTAIN_PLAN")
public class EqMaintainPlan extends BaseEntity {

    private static final long serialVersionUID = 1L;

    /**
     * 计划单号
     */
    @TableField("PLAN_NO")
    private String planNo;

    /**
     * 设备id
     */
    @TableField("EQUIPT_ID")
    private String equiptId;

    /**
     * 设备编码
     */
    @TableField("EQUIPT_CODE")
    private String equiptCode;

    /**
     * 保养类型
     */
    @TableField("MAINTAIN_TYPE")
    private String maintainType;

    /**
     * 计划类型：1单次，2多次
     */
    @TableField("PLAN_TYPE")
    private String planType;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone="GMT+8")
    @TableField(fill = FieldFill.UPDATE)
    private Timestamp startDate;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone="GMT+8")
    @TableField(fill = FieldFill.UPDATE)
    private Timestamp endDate;


    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone="GMT+8")
    @TableField(fill = FieldFill.UPDATE)
    private Timestamp nextDate;


    /**
     * cron表达式
     */
    @TableField("CRON")
    private String cron;

    /**
     * cron表达式
     */
    @TableField("CRON_DESC")
    private String cronDesc;


    /**
     * 计划状态：0 暂存，5提交 10执行中 4暂停   99计划结束
     */
    @TableField("PLAN_STATUS")
    private String planStatus;


    /**
     * 备注
     */
    @TableField("REMARK")
    private String remark;

    /**
     * 序号
     */
    @TableField("SEQ")
    private Integer seq;

    @TableField(exist = false)
    private String equiptName;
    @TableField(exist = false)
    private String specification;

    @TableField(exist = false)
    private List<EqMaintainPlanPerson> maintainPlanPersonList;
    @TableField(exist = false)
    private List<EqMaintainPlanDetail> maintainPlanDetailList;
}
